// 文件路径: vitality/src/http/adminApi.js
import axios from "@/http/request.js";

//管理员接口
const adminApi = {
  //登录
  login(data) {
    return axios({
      method: "post",
      url: "/admin/login",
      data,
    });
  },
  
  // 用户管理接口（陪玩管理）
  // 分页查询陪玩用户 (user_role=2 且 user_status!=1)
  getAccompanyingUsers(data) {
    return axios({
      method: "post",
      url: "/admin/users/page",
      data
    });
  },
  
  // 添加陪玩用户
  addAccompanyingUser(data) {
    return axios({
      method: "post",
      url: "/admin/users/add",
      data
    });
  },
  
  // 修改陪玩用户
  updateAccompanyingUser(data) {
    return axios({
      method: "post",
      url: "/admin/users/update",
      data
    });
  },
  
  // 删除陪玩用户（逻辑删除）
  deleteAccompanyingUser(data) {
    return axios({
      method: "post",
      url: "/admin/users/delete",
      data
    });
  },
  
  // 根据ID查询陪玩详细信息
  getPlaymateDetail(data) {
    return axios({
      method: "post",
      url: "/playmate/detail",
      data
    });
  },
 getAddressList() {
    return axios({
      method: "post",
      url: "/admin/address/inquiry", // 对应后端地址查询接口
      data: {} // 若接口需要参数可补充，当前无参数
    });
  },

 getAccompanyingUserDetail(data) {
    return axios({
      method: "post",
      url: "/admin/users/detail", // 与后端Controller接口路径一致
      data // 入参为 {id: 用户ID}
    });
  },
   getBossList(data) {
    return axios({
      method: "post",
      url: "/admin/boss/page",
      data
    });
  },
  
  // 添加老板用户
  addBoss(data) {
    return axios({
      method: "post",
      url: "/admin/boss/add",
      data
    });
  },
  
  // 修改老板状态（启用/禁用）
  updateBossStatus(data) {
    return axios({
      method: "post",
      url: "/admin/boss/updateStatus",
      data
    });
  },
  
  // 删除老板（逻辑删除，带绑定校验）
  deleteBoss(data) {
    return axios({
      method: "post",
      url: "/admin/boss/delete",
      data
    });
  },
  
  // 根据ID查询老板详情
  getBossDetail(data) {
    return axios({
      method: "post",
      url: "/admin/boss/detail",
      data
    });
  },
  getFinances(data) {
    return axios({
      method: "post",
      url: "/admin/finances/page",
      data
    });
  },
  
  addFinance(data) {
    return axios({
      method: "post",
      url: "/admin/finances/add",
      data
    });
  },
  
  updateFinance(data) {
    return axios({
      method: "post",
      url: "/admin/finances/update",
      data
    });
  },
  
  deleteFinance(data) {
    return axios({
      method: "post",
      url: "/admin/finances/delete",
      data
    });
  },
  
  getFinanceDetail(data) {
    return axios({
      method: "post",
      url: "/admin/finances/detail",
      data
    });
  },
  // 客服管理接口
getCustomerServiceList(data) {
  return axios({
    method: "post",
    url: "/admin/customerService/page",
    data
  });
},

addCustomerService(data) {
  return axios({
    method: "post",
    url: "/admin/customerService/add",
    data
  });
},

updateCustomerServiceStatus(data) {
  return axios({
    method: "post",
    url: "/admin/customerService/updateStatus",
    data
  });
},

deleteCustomerService(data) {
  return axios({
    method: "post",
    url: "/admin/customerService/delete",
    data
  });
},

getCustomerServiceDetail(data) {
    return axios({
      method: "post",
      url: "/admin/customerService/detail",
      data
    });
  },

  // 更新客服信息
  updateCustomerService(data) {
    return axios({
      method: "post",
      url: "/admin/customerService/update",
      data
    });
  },
  
  // 获取客服详细信息（所有字段）
  getCustomerServiceDetailAll(data) {
    return axios({
      method: "post",
      url: "/admin/customerService/detailAll",
      data
    });
  },
  
   // 游戏类型管理
  getGameTypeList(data) {
    return axios({
      method: "post",
      url: "/admin/gameType/page",
      data
    });
  },
  addGameType(data) {
    return axios({
      method: "post",
      url: "/admin/gameType/add",
      data
    });
  },
  updateGameType(data) {
    return axios({
      method: "post",
      url: "/admin/gameType/update",
      data
    });
  },
  deleteGameType(data) {
    return axios({
      method: "post",
      url: "/admin/gameType/delete",
      data
    });
  },
  getGameTypeDetail(data) {
    return axios({
      method: "post",
      url: "/admin/gameType/detail",
      data
    });
  },
  
  // 游戏段位管理
  getGameLevelList(data) {
    return axios({
      method: "post",
      url: "/admin/gameLevel/page",
      data
    });
  },
  addGameLevel(data) {
    return axios({
      method: "post",
      url: "/admin/gameLevel/add",
      data
    });
  },
  updateGameLevel(data) {
    return axios({
      method: "post",
      url: "/admin/gameLevel/update",
      data
    });
  },
  deleteGameLevel(data) {
    return axios({
      method: "post",
      url: "/admin/gameLevel/delete",
      data
    });
  },
  getGameLevelDetail(data) {
    return axios({
      method: "post",
      url: "/admin/gameLevel/detail",
      data
    });
  },
  getLevelsByGameType(data) {
    return axios({
      method: "post",
      url: "/admin/gameLevel/getByGameType",
      data
    });
  },
  // 结算比例配置
  getRatingList(data) {
    return axios({
      method: "post",
      url: "/admin/rating/page",
      data
    });
  },
  getRatingDetail(data) {
    return axios({
      method: "post",
      url: "/admin/rating/detail",
      data
    });
  },
  addRating(data) {
    return axios({
      method: "post",
      url: "/admin/rating/add",
      data
    });
  },
  updateRating(data) {
    return axios({
      method: "post",
      url: "/admin/rating/update",
      data
    });
  },
  
  // 老板报表
  getBossReportData(data) {
    return axios({
      method: "post",
      url: "/admin/report/boss/page",
      data
    });
  },
  
  // 陪玩报表
  getPlaymateReportData(data) {
    return axios({
      method: "post",
      url: "/admin/report/playmate/page",
      data
    });
  },
  
  // 客服报表
  getCustomerServiceReportData(data) {
    return axios({
      method: "post",
      url: "/admin/report/customerService/page",
      data
    });
  },
   // 礼物管理接口
  getGiftList(data) {
    return axios({
      method: "post",
      url: "/admin/gift/page",
      data
    });
  },
  
  getGiftDetail(data) {
    return axios({
      method: "post",
      url: "/admin/gift/detail",
      data
    });
  },
  
  addGift(data) {
    return axios({
      method: "post",
      url: "/admin/gift/add",
      data
    });
  },
  
  updateGift(data) {
    return axios({
      method: "post",
      url: "/admin/gift/update",
      data
    });
  },
  
  deleteGift(data) {
    return axios({
      method: "post",
      url: "/admin/gift/delete",
      data
    });
  },
   getPlaymateFinancialReport(data) {
    return axios({
      method: "post",
      url: "/admin/report/financial/playmate",
      data
    });
  },
  getBossFinancialReport(data) {
    return axios({
      method: "post",
      url: "/admin/report/financial/boss",
      data
    });
  },
  getPlatformFinancialReport(data) {
    return axios({
      method: "post",
      url: "/admin/report/financial/platform",
      data
    });
  },
 getOrderList(data) {
  return axios({
    method: "post",
    url: "/admin/order/page", // 匹配后端 /admin/order/page
    data
  });
},

getOrderDetail(data) {
  return axios({
    method: "post",
    url: "/admin/order/detail", // 匹配后端 /admin/order/detail
    data
  });
},

updateOrderStatus(data) {
  return axios({
    method: "post",
    url: "/admin/order/updateStatus", // 已一致，无需修改
    data
  });
},

deleteOrder(data) {
  return axios({
    method: "post",
    url: "/admin/order/delete", // 匹配后端 /admin/order/delete
    data
  });
}
  
};

export default adminApi;